#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N = 110;
string s1, s2;
int n, m, k;
int a[N], b[N];
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> m >> k;
		cin >> s1 >> s2;
		string ans;
		sort(s1.begin(), s1.end());
		sort(s2.begin(), s2.end());
		int cnt1 = 0, cnt2 = 0;
		for (int i = 0, j = 0; i < n && j < m;) {
			if (cnt1 == k) {
				cnt1 = 0;
				cnt2 = 1;
				ans += s2[j];
				j++;
			}
			else if (cnt2 == k) {
				cnt2 = 0;
				cnt1 = 1;
				ans += s1[i];
				i++;
			}
			else if (s1[i] <= s2[j]) {
				ans += s1[i];
				cnt1++;
				cnt2 = 0;
				i++;
			}
			else if (s1[i] > s2[j]) {
				ans += s2[j];
				cnt1 = 0;
				cnt2++;
				j++;
			}
		}
		cout << ans << endl;
	}
	return 0;
}